/**
 * jt_ProgressBar.js - Progress Bar widget
 *
 * @version 29 Apr 2005
 * @author  Joseph Oster, wingo.com, Copyright (c) 2005-2006
 */

jt_ProgressBar = function(parent, width, fontSize, barClass) {
  // constructor for Progress Bar object; 'width' and 'fontSize' in pixels
  this.pixels = width;
  this.outerDIV = document.createElement("div");
  this.outerDIV.style.border = "1px solid #000000";
  this.outerDIV.style.background = "#FFFFFF";
  this.outerDIV.style.fontFamily = "Arial,Verdana";
  this.outerDIV.style.fontSize = fontSize + "px";
  this.outerDIV.style.width = (width + 2) + "px";
  this.outerDIV.style.textAlign = "left";
  parent.appendChild(this.outerDIV);

  this.fillDIV = document.createElement("div");
  this.fillDIV.style.textAlign = "right";
  this.fillDIV.style.overflow = "hidden";
  this.fillDIV.innerHTML = "x";
  this.fillDIV.style.width = "0px";
  if (barClass) this.fillDIV.className = barClass;
  else {
    this.fillDIV.style.background = "#00008b";
    this.fillDIV.style.border = "1px solid #FFFFFF";
    this.fillDIV.style.color = "#FFFFFF";
    }
  this.outerDIV.appendChild(this.fillDIV);
  }

jt_ProgressBar.prototype.setPercent = function(pct) {
  var fillPixels = Math.round(this.pixels * (pct/100));
  this.fillDIV.innerHTML = pct + "%";
  this.fillDIV.style.width = fillPixels + "px";
  
  }
